#!/usr/bin/perl -w
## dsvn for svn commit in /home/elthariel/code/lab-audio/progs/patate
##
## Made by Nahlwe
## Login   <elthariel@epita.fr>
##
## Started on  Sun May 20 15:31:31 2007 Nahlwe
## Last update Sun May 20 15:50:52 2007 Nahlwe
##

my @file;

open CONFIGURE, "<", "configure.in" or die "Unable to open configure.in (ro)";
@file = <CONFIGURE>;

foreach $line (@file)
{
    if ($line =~ /(AM_INIT_AUTOMAKE\(\w+, \d+\.\d+\.)(\d+)(\))/)
    {
        $line = $1.($2 + 1).$3."\n";
    }
}

close CONFIGURE;
open CONFIGURE, ">", "configure.in"
    or die "Unable to open configure.in fr writing \n";
print CONFIGURE @file;
close CONFIGURE;

if (defined $ARGV[0])
{
    print `svn ci -m \"$ARGV[0]\"`;
}
else
{
    print `svn ci`;
}

